-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/23 validate raw params #27
Conversation
reanme file to function name
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 97.65% 97.79% +0.13%
==========================================
Files 7 8 +1
Lines 511 543 +32
==========================================
+ Hits 499 531 +32
Misses 12 12 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an exported function, it's good to ensure the input args are well documented (NIT: ideally with an example). Otherwise this looks good! Tests explain the behaviour quite well.
Just for my understanding, when you specify "raw" here, you mean a JSON that may not exactly fit the final expected JSON input (e.g. may need to expand some inherit
rules to get to that point)?
And then parse_params
expected an input JSON that explicitly has all of the necessary keys?
R/parse_raw_params.R
Outdated
#' @param json JSON string | ||
#' @param inheritence_search_paths value | ||
#' @param schema_file value | ||
#' @param raw_schema_file value | ||
#' @return returndes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add better documentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: lintr
failures, but otherwise LGTM
following merge of RMI-PACTA/pacta.workflow.utils#27
Closes #23
Provides a unified interface for parsing and validating JSON params, including raw-schema validation (checking that params are either valid, or contain an appropriate
inherit
key)